<script lang="ts" setup>
defineProps<{
  repeatBgImg?: string
  bgColor?: string
}>()
</script>
<template>
  <div class="BgVue2 max-window">
    <div class="topImg">
      <slot name="topImg"></slot>
    </div>
    <div
      class="content"
      :style="{
        backgroundImage: repeatBgImg ? `url(${repeatBgImg})` : '',
        backgroundColor: bgColor ? bgColor : '',
      }"
    >
      <slot></slot>
    </div>
    <div class="bottomImg">
      <slot name="bottomImg"></slot>
    </div>
  </div>
</template>

<style lang="less" scoped>
.BgVue2 {
  .topImg {
    :deep(img) {
      display: block;
      width: 100%;
    }
  }
  .bottomImg {
    :deep(img) {
      display: block;
      width: 100%;
    }
  }
  .content {
    background-size: 100% auto;
    margin-top: -1px;
  }
}
</style>
